<%-- 
    Document   : index
    Created on : 23/04/2011, 19:45:55
    Author     : Josiane
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<script>
//validaçao form login
function validarForm(){
    if (document.login.txtUsuario.value=="") {
        alert('INFORME O USUÁRIO!');
        document.login.txtUsuario.focus();
        return;
    }
    else
        if (document.login.txtSenha.value=="") {
        alert('DIGITE A SENHA!');
        document.login.txtSenha.focus();
        return;
    }
    else {
        document.login.txtSubmit.value="1";
        document.login.submit();
    }
   }

</script>


<%
    String acao = new String();
    acao = request.getParameter("txtSubmit");

    if (acao != null){
        //salva usuario na session e redireciona para tela de cadastro
        session.setAttribute("usuario", request.getParameter("txtUsuario"));
        response.sendRedirect("Controle.jsp");
    }
%>

<html>
<head>
    <link href="default.css" rel="stylesheet" type="text/css">
<title>CPD Online - Controle de Chamados (FACENSA - LP3)</title>
</head>
<body>
<br><br>
<form name="login">
<h4 align= "center"><font color= "#00BF00">CPD ONLINE - CONTROLE DE CHAMADOS</font></h4>
<table border="0" align="center" width="40%">
    <tr><td align="center"><b>LOGIN</b></td></tr>
	<tr>
          <td align="center"><br>
          <b>Usuario:</b> &nbsp;
          <input name="txtUsuario" type="text" maxlength="10">
         <br>
          </tr>
	 <tr>
          <td align="center"><br>
          <b>Senha:</b> &nbsp;
          <input name="txtSenha" type="text" maxlength="10">
          <br>
          <br>
        <input type="button" name="btnAcessar" value="Acessar" Onclick="validarForm()">
        <br><br>
      </td>
  </tr>
</table>
<input type="hidden" name="txtSubmit" value="0">
</form>
<div id="rodape">
<br><br>
©  JSP™ 2011. Todos os direitos reservados.
</div>
</body>
</body>
</html>